package com.xiaohe.controller;

import com.xiaohe.pojo.User;
import com.xiaohe.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

import java.util.List;

/**
 * 功能描述
 *
 * @author 和振斌
 * @date 2021/1/3
 * @return
 */
@Controller
@RequestMapping("/user")
public class UserController {

    @Autowired
    private UserService userService;

    //查询所有的用户信息
    @RequestMapping("/findAll")
    public String findAll(){
        List<User> user = userService.findAll();
        for (User user1 : user) {
            System.out.println(user1);
        }
        return "userList";
    }
}
